﻿using System.Collections;
using UnityEngine;
using static RoleController;

public class MonsterStateIdle : FSMState
{
    private MonsterController monsterController => fsm.role as MonsterController;
    public override void Enter()
    {
        monsterController.SetState(RoleState.Idle);
    }

    public override void Exit()
    {

    }

    public override void Update()
    {
        monsterController.FindTarget();
        if (monsterController.target != null)
        {
            fsm.SetState("FightIdle");
        }
        else if (monsterController.type == MonsterController.MonsterType.Monster)
        {
            fsm.SetState("Patrol");
        }
    }
}
